/********************************************************************************
 * Project Name		[JavaSE_Fundamentals]
 * File Name     	[PersonTest.java]
 * Creation Date 	[2015-01-01]
 * 
 * Copyright© ge.y.yang@gmail.com All Rights Reserved
 * 
 * Work hard, play harder, think big and keep fit
 ********************************************************************************/
package swing.listener;

/**
 * @author 不落的太阳(Sean Yang aka ShortPeace)
 * @version 1.0
 * @since jdk 1.8
 * 
 */
public class PersonTest {

	public static void main(String[] args) {
		Person person = new Person("Sean");

		person.registerListener(new PersonListener() {
			@Override
			public void doEat(PersonEvent e) {
				Person p = e.getSource();
				System.out.println(p + "在吃东西");
			}

			@Override
			public void doRun(PersonEvent e) {
				Person p = e.getSource();
				System.out.println(p + "在运动");
			}
		});

		person.eat();
		person.run();
	}
}
